<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="count">
    <button onclick="charge()">充值</button>
    <input type="text" id="text2">
    <hr>
    <button onclick="del()">删除最后一个元素</button>
    <button onclick="add()">在末尾添加一个元素</button>
    <button onclick="shift()">删除第一个元素</button>
    <button onclick="unshift()">在头部添加元素</button>
    <script>
        function charge(){
            let jin = count.value
            if(isNaN(jin) || jin == 0){
                alert('没钱你玩个P')
            }else{
                alert(jin)
            }
            text2.value = jin   
        }
        let arr2 = [4396,true,"Tonyの马"]
        let arr1 = [15,"起飞",false,arr2]
            console.log(arr1[1])
            console.log(arr1[3])
        function del(){
            arr2.pop();
            console.log(arr2)
        }
        function add(){
            arr2.push("🐎🌻");
            console.log(arr2)
        }function shift(){
            arr2.shift();
            console.log(arr2)
        }function unshift(){
            arr2.unshift('🌻🐎');
            console.log(arr2)
        }
    </script>
</body>
</html>